﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Admin/MasterPage/AdminSubMasterPage.master" AutoEventWireup="true" CodeFile="Sec005a.aspx.cs" Inherits="Admin_Sys_Sec_Sec005a" %>

<asp:Content ID="Content1" runat="server" ContentPlaceHolderID="head">
    <style type="text/css">
        input.correct
        {
            border: 1px solid green;
        }
        
        input.error
        {
            border: 1px solid red;
        }
        
        #tips
        {
            float: left;
            margin: 5px 0 0 20px;
        }
        
        #tips span
        {
            float: left;
            width: 50px;
            height: 20px;
            color: #fff;
            overflow: hidden;
            background: #ccc;
            margin-right: 2px;
            line-height: 20px;
            text-align: center;
        }
        
        #tips.s1 .active
        {
            background: #f30;
        }
        
        #tips.s2 .active
        {
            background: #fc0;
        }
        
        #tips.s3 .active
        {
            background: #cc0;
        }
        
        #tips.s4 .active
        {
            background: #090;
        }
    </style>
    <script type="text/javascript">
        window.onload = function () {
            var oTips = document.getElementById("tips");
            var oInput = document.getElementById("txtConPwd");
            var aSpan = oTips.getElementsByTagName("span");
            var aStr = ["弱", "中", "强", "非常好"];
            var i = 0;
            oInput.onkeyup = oInput.onfocus = oInput.onblur = function () {
                var index = checkStrong(this.value);
                //this.className = index ? "correct" : "error";
                oTips.className = "s" + index;
                for (i = 0; i < aSpan.length; i++)
                    aSpan[i].className = aSpan[i].innerHTML = "";
                if (index == 4) {
                    index && (aSpan[index - 1].className = "active", aSpan[index - 1].innerHTML = aStr[index - 1]);
                    index && (aSpan[index - 2].className = "active", aSpan[index - 2].innerHTML = aStr[index - 2]);
                    index && (aSpan[index - 3].className = "active", aSpan[index - 3].innerHTML = aStr[index - 3]);
                    index && (aSpan[index - 4].className = "active", aSpan[index - 4].innerHTML = aStr[index - 4]);
                } else if (index == 3) {
                    index && (aSpan[index - 1].className = "active", aSpan[index - 1].innerHTML = aStr[index - 1]);
                    index && (aSpan[index - 2].className = "active", aSpan[index - 2].innerHTML = aStr[index - 2]);
                    index && (aSpan[index - 3].className = "active", aSpan[index - 3].innerHTML = aStr[index - 3]);
                } else if (index == 2) {
                    index && (aSpan[index - 1].className = "active", aSpan[index - 1].innerHTML = aStr[index - 1]);
                    index && (aSpan[index - 2].className = "active", aSpan[index - 2].innerHTML = aStr[index - 2]);
                } else if (index == 1) {
                    index && (aSpan[index - 1].className = "active", aSpan[index - 1].innerHTML = aStr[index - 1]);
                }
            };

        };

        /** 强度规则

        + ------------------------------------------------------- +

        1) 任何少于6个字符的组合，弱；任何字符数的同类字符组合，弱；

        2) 任何字符数的两类字符组合，中；

        3) 12位字符数以下的三类或四类字符组合，强；

        4) 12位字符数以上的三类或四类字符组合，非常好。

        + ------------------------------------------------------- +

        **/

        //检测密码强度

        function checkStrong(sValue) {
            var modes = 0;
            if (sValue.length < 2)
                return modes;
            if (/\d/.test(sValue))
                modes++;
            //数字

            if (/[a-z]/.test(sValue))
                modes++;
            //小写
            if (/[A-Z]/.test(sValue))
                modes++;
            //大写

            if (/\W/.test(sValue))
                modes++;
            //特殊字符

            switch (modes) {
                case 1:
                    return 1;
                    break;
                case 2:
                    return 2;
                case 3:
                case 4:
                    return sValue.length < 12 ? 3 : 4;
                    break;

            }

        }

    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <table width="100%" border="0" cellspacing="0" cellpadding="0" class="Service_table_tow">
        <tr>
            <td colspan="2" class="xin_y1 caption" align="center">
                帐号信息管理
            </td>
        </tr>
        <tr>
            <td class="xin_y2">
                角色
            </td>
            <td>
                <span style="color: #FF6600;">
                    <yncWebDDL:DrpRoles ID="drpRole" runat="server" Width="160px" ShowSelectedItem="false"
                        RoleCodePrefix="GPRS">
                    </yncWebDDL:DrpRoles>
                </span>
            </td>
        </tr>
        <tr>
            <td class="xin_y2">
                登录帐号
            </td>
            <td>
                <span style="color: #FF6600;">
                    <yncWeb:yncTextBox ID="txtUser" runat="server" Width="160px" Required="true"></yncWeb:yncTextBox>
                    <asp:TextBox ID="txtUserID" runat="server" Visible="false"></asp:TextBox>
                </span>
            </td>
        </tr>
        <tr>
            <td class="xin_y2">
                密码
            </td>
            <td>
                <div style="float:left;">
                    <yncWeb:yncTextBox ClientIDMode="Static" ID="txtPwd" runat="server" Width="160px"  TextMode="Password"
                         MinValueLength="6" Required="true"></yncWeb:yncTextBox>
                </div>
                  
            </td>
        </tr>
        <tr>
            <td class="xin_y2">
                确认密码
            </td>
            <td>
                <div style="float:left;">
                    <yncWeb:yncTextBox ID="txtConPwd" ClientIDMode="Static" runat="server" Width="160px" TextMode="Password"
                         MinValueLength="6" Required="true" EqualToFiledText="密码" EqualToField="txtPwd"></yncWeb:yncTextBox>
                </div>
                    <div id="tips">
                        <span></span><span></span><span></span><span></span>
                    </div>
            </td>
        </tr>
        <tr>
            <td class="xin_y2">
                联系人
            </td>
            <td>
                <span style="color: #FF6600;">
                    <yncWeb:yncTextBox ID="txtName" runat="server" Width="240px" Required="true"></yncWeb:yncTextBox>
                </span>
            </td>
        </tr>
        <tr>
            <td class="xin_y2">
                上级领导
            </td>
            <td>
                <span style="color: #FF6600;">
                    <yncWeb:yncTextBox ID="txtManager" runat="server" Width="240px"></yncWeb:yncTextBox>
                </span>
            </td>
        </tr>
        <tr>
            <td class="xin_y2">
                部门
            </td>
            <td>
                <span style="color: #FF6600;">
                    <yncWebDDL:DrpCodeTable ID="drpDept" runat="server" Category="CTE001" ShowSelectedItem="false"></yncWebDDL:DrpCodeTable>
                </span>
            </td>
        </tr>
        <tr>
            <td class="xin_y2">
                所属机构
            </td>
            <td>
                <span style="color: #FF6600;">
                    <yncWebDDL:DrpThirdUnit ID="drpUnit" runat="server" ShowSelectedItem="false"></yncWebDDL:DrpThirdUnit>
                </span>
            </td>
        </tr>
        <tr>
            <td class="xin_y2">
                邮件
            </td>
            <td>
                <span style="color: #FF6600;">
                    <yncWeb:yncTextBox ID="txtMail" runat="server" Width="240px" Required="true" ValidateType="Email"></yncWeb:yncTextBox>
                </span>
            </td>
        </tr>
      
        <tr>
            <td class="xin_y2">
                状态
            </td>
            <td>
                <span style="color: #FF6600;">
                    <asp:RadioButton ID="radActive" Text="激活" runat="server" Checked="true" GroupName="active" /><asp:RadioButton
                        ID="radInactive" Text="未激活" runat="server" GroupName="active" />
                </span>
            </td>
        </tr>
        <tr>
            <td colspan="2" class="xin_y2" align="right">
                <asp:Button ID="btnSave" runat="server" Text="确认" OnClick="btnSave_Click" />
                <input type="button" value="关闭" onclick="javascript:window.top.CloseDialog(false);" />
            </td>
        </tr>
        <tr>
            <td colspan="2" align="center" height="24px">
                <asp:Label ID="lbMessage" runat="server" ForeColor="Red" Text="&nbsp;" Font-Bold="true" />
            </td>
        </tr>
    </table>
</asp:Content>

